package com.example.myapplication;


import com.example.base.base.base1.BasePresenter;
import com.example.base.utils.LogUtil;
import com.example.network_lib.MyObserver;
import com.example.network_lib.RequestUtils;
import com.example.network_lib.module.UpdateAppBean;

/**
 * @author Administrator
 * @createTime 2019/9/30 11:08
 */
public class MainPresenter extends BasePresenter<IMainContractView.View> implements IMainContractView.Presenter {


    @Override
    public void getMainData() {
        RequestUtils.getDemo(((MainActivity) mView), new MyObserver<UpdateAppBean>(((MainActivity) mView)) {
            @Override
            protected void onSuccess(UpdateAppBean result) {
                if (result != null) {
                    mView.getMainDataSuccess(result);
                }
            }

            @Override
            protected void onFailure(Throwable e, int code, String errMsg) {
                LogUtil.d(errMsg);
            }
        });
    }
}
